/**
 * Copyright(c) 2020 NESENSOR.
 * <p>
 * History:
 * 2019/9/12 0012 15:25 Created by Author_zero
 */
package com.funtl.spring.cloud.alibaba.consumer.controller;

import com.funtl.spring.cloud.alibaba.consumer.service.EchoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * TODO: Must write comments.
 *
 * @author <a href="mailto:Author_zero@nesensor.com">Author_zero</a>
 * @version 1.0 2019/9/12 0012 15:25
 */
//动态刷新
@RefreshScope
@RestController
public class TestEchoController {

    @Autowired
    EchoService echoService;

    @Value("${user.name}")
    private String username;

    @GetMapping(value = "/feign/echo/{str}")
    public String echo(@PathVariable String str) {
        return echoService.echo(str);
    }

    @GetMapping(value = "/lb")
    public String lb() {
        return echoService.lb();
    }

    @GetMapping(value = "/config")
    public String config() {
        return echoService.echo(username);
    }
}
